//
//  Date+Extend.swift
//  AUCharge
//
//  Created by HeHeAdmin on 2019/5/22.
//  Copyright © 2019 HeHeAdmin. All rights reserved.
//

import Foundation
extension Date {
    
    /// 当前时间戳
    ///
    /// - Parameter isTen: true：10位  还是13位
    /// - Returns: 时间戳字符串
    public static func currtentTimeStamp(isTen:Bool) -> String {
        let now = self.init();
        let timeInterval:TimeInterval  = now.timeIntervalSince1970;
        if isTen {
            let timeStamp = Int(timeInterval)
            return "\(timeStamp)"
        }
        let millisecond = CLongLong(round(timeInterval*1000))
        return "\(millisecond)"
    }

}
